Fix a few testsuite failures
authorTimm Bäder <mail@baedert.org>
Thu, 13 Jul 2017 14:28:49 +0000 (16:28 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:16 +0000 (21:27 -0400)
Adjust default property values, skip GtkRange:adjustment.

gtk/gtkentry.c
gtk/gtkeventbox.c
gtk/gtkspinbutton.c
testsuite/gtk/defaultvalue.c
testsuite/gtk/gtkmenu.c

index 478092011a27d428b51ed257001216d6e1f594a6..5c3a9f1915b756603341a3dc5999116b2ebf156e 100644 (file)
@@ -7864,7 +7864,7 @@ gtk_entry_get_icon_sensitive (GtkEntry             *entry,
   icon_info = priv->icons[icon_pos];
 
   if (!icon_info)
-    return FALSE;
+    return TRUE; /* Default of the property */
 
   return gtk_widget_get_sensitive (icon_info->widget);
 }
index ae1b5332c48fda8e1e7f3fd36336396fbb629a2c..6a6ba9f2eb605b571417c6931e23495eb63e8df9 100644 (file)
@@ -95,7 +95,7 @@ gtk_event_box_class_init (GtkEventBoxClass *class)
                                    g_param_spec_boolean ("visible-window",
                                                         P_("Visible Window"),
                                                         P_("Whether the event box is visible, as opposed to invisible and only used to trap events."),
-                                                        TRUE,
+                                                        FALSE,
                                                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
   g_object_class_install_property (gobject_class,
                                    PROP_ABOVE_CHILD,
index 2593cd8bd1d7c3fff3e5c205facd1589fa4681a4..71498d90718612fa093980a41a46b3a1e3b3c12f 100644 (file)
@@ -422,7 +422,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
                                    g_param_spec_string ("text",
                                    P_("Text"),
                                    P_("The contents of the entry"),
-                                   "",
+                                   "0",  /* Default value of the default adjustment */
                                    GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
 
   g_object_class_override_property (gobject_class,
@@ -436,8 +436,8 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
    *
    * The ::input signal can be used to influence the conversion of
    * the users input into a double value. The signal handler is
-   * expected to use gtk_entry_get_text() to retrieve the text of
-   * the entry and set @new_value to the new value.
+   * expected to use gtk_spin_button_get_text() to retrieve the text of
+   * the spinbutton and set @new_value to the new value.
    *
    * The default conversion uses g_strtod().
    *
index e54b499d706d8421c16ada42f949fe1049700971..698471e199d0e6ed83db28de569490b2b2f042b3 100644 (file)
@@ -331,6 +331,18 @@ G_GNUC_END_IGNORE_DEPRECATIONS
           strcmp (pspec->name, "show-desktop") == 0)
         continue;
 
+      /* GtkRange constructs an adjustment on its own if NULL is set and
+       * the property is a CONSTRUCT one, so the returned value is never NULL. */
+      if (g_type_is_a (type, GTK_TYPE_RANGE) &&
+          strcmp (pspec->name, "adjustment") == 0)
+        continue;
+
+      /* ... and GtkScrollbar wraps that property. */
+      if (g_type_is_a (type, GTK_TYPE_SCROLLBAR) &&
+          strcmp (pspec->name, "adjustment") == 0)
+        continue;
+
+
       if (g_test_verbose ())
       g_print ("Property %s.%s\n",
             g_type_name (pspec->owner_type),
index c17d50aa75bc8b63649b35203a5f22f22da8061b..589576c6d8577672de3f1939c4623d31eace76bc 100644 (file)
@@ -228,6 +228,8 @@ get_label (GtkMenuItem *item)
         children = g_list_concat (children, gtk_container_get_children (children->data));
       else if (GTK_IS_LABEL (children->data))
         label = gtk_label_get_text (children->data);
+      else if (GTK_IS_ACCEL_LABEL (children->data))
+        label = gtk_accel_label_get_label (children->data);
 
       children = g_list_delete_link (children, children);
     }
@@ -372,6 +374,8 @@ assert_section_equality (GSList      **children,
       contents = gtk_bin_get_child ((*children)->data);
       if (GTK_IS_LABEL (contents))
         label = gtk_label_get_label (GTK_LABEL (contents));
+      else if (GTK_IS_ACCEL_LABEL (contents))
+        label = gtk_accel_label_get_label (GTK_ACCEL_LABEL (contents));
       else
         label = "";